package com.oracle.oa.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;



@Entity                        
@Table(name="messagetouser")
public class Messagetouser  implements java.io.Serializable {

	 @GenericGenerator(name = "generator", strategy = "increment")
	 @Id
	 @GeneratedValue(generator = "generator")
	 @Column(name = "id", unique = true, nullable = false)
     private int id;
	 @ManyToOne
 	 @JoinColumn(name = "userinfo_id")
     private Userinfo userinfo;
	 @ManyToOne
 	 @JoinColumn(name = "message_id")
     private Message message;
	 @Column(name = "ifread")
     private int ifread;
	 
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public Userinfo getUserinfo() {
		return userinfo;
	}
	public void setUserinfo(Userinfo userinfo) {
		this.userinfo = userinfo;
	}
	public Message getMessage() {
		return message;
	}
	public void setMessage(Message message) {
		this.message = message;
	}
	public int getIfread() {
		return ifread;
	}
	public void setIfread(int ifread) {
		this.ifread = ifread;
	}
	public Messagetouser(int id, Userinfo userinfo, Message message, int ifread) {
		this.id = id;
		this.userinfo = userinfo;
		this.message = message;
		this.ifread = ifread;
	}
	
	public Messagetouser(Userinfo userinfo, Message message, int ifread) {
		this.userinfo = userinfo;
		this.message = message;
		this.ifread = ifread;
	}
	@Override
	public String toString() {
		return "Messagetouser [id=" + id + ", userinfo=" + userinfo
				+ ", message=" + message + ", ifread=" + ifread + "]";
	}


}